﻿<h2 class="product-title">Reviews</h2>
<p data-bind="if: reviews().length == 0">
    No one has reviewed this product yet. Be the first.
</p>

<div data-bind="if: reviews().length > 0">
    <div data-bind="foreach: reviews">
        <div class="product-review">
            <div class="rating" data-bind="ratingValue: rating, ratingReadonly: true"></div>
            <span class="review-user-id" data-bind="text: userId"></span> on 
            <span class="review-date" data-bind="text: reviewDate"></span>
            <a href="javascript:void(0)" data-bind="href: $parent.getEditReviewUrl($data)">view</a>
        </div>
        <p data-bind="text: comments" class="review-comment"></p>
    </div>
    <div data-bind="with: pager">
        @Html.Partial("Pagination")
    </div>
</div>
